// Copyright (c) 2022, hzmes and contributors
// For license information, please see license.txt
/* eslint-disable */

frappe.query_reports["SRMSampleRequest hui.lei"] = {
	"filters": [
		{
			"fieldname": "priority",
			"fieldtype": "Select",
			"label": "优先级",
			"options": ['', '急','较急','一般'],
			"default": '',
			"width": 0
		},
		{
			"fieldname": "workflow_state",
			"fieldtype": "Select",
			"label": "工作流状态",
			"options": ['', 'Save','Hand In','Be Received','Rejected','Return From Purchase','Finish','Cancelled'],
			"default": '',
			"width": 0
		},
		{
			"fieldname": "creation_from",
			"fieldtype": "Date",
			"label": "制单日期从",
			"default": frappe.datetime.year_start(),
			"width": 0
		},
		{
			"fieldname": "creation_to",
			"fieldtype": "Date",
			"label": "制单日期到",
			"default": frappe.datetime.year_end(),
			"width": 0
		},
	],

	// "formatter": function(value, row, column, data, default_formatter) {
		
	// 	if (column.fieldname=="优先级") {
	// 		value = data.优先级;

	// 		// column.link_onclick =
	// 		// 	"frappe.query_reports['Profitability Analysis'].open_profit_and_loss_statement(" + JSON.stringify(data) + ")";
	// 		// column.is_tree = true;
	// 	}
		
	// 	// value = default_formatter(value, row, column, data);

	// 	if (data.优先级) {
	// 		// console.log(data["优先级"])
	// 		value = $(`<span>${value}</span>`);
			
	// 		var $value = $(value).css("font-weight", "bold");
			
	// 		if (data.优先级 == "急") {
	// 		$value.addClass("text-info");
	// 		}
	// 		if (data.优先级 == "较急") {
	// 			$value.addClass("text-warning");
	// 		}
	// 		// console.log(value)
	// 		value = $value.wrap("<p></p>").parent().html();
	// 	}

	// 	return value;
	// },
};
